<?php 
		if(isset($_GET['numPage'])){
		
			$reqPages = "SELECT * FROM pages WHERE numPage = ".$_GET['numPage']."";
			$queryUnePage = $bdd->query($reqPages);
		
			while($page = $queryUnePage->fetch()){
			
				echo'<form action = "ctrl_Administration.php" method = "post" />
						<table>
								<tr>
									<td>
										<input type = "text" name = "titre" value = "'.$page['libellePage'].'" />
									</td>
								</tr>
								<tr>
									<td>
										<textarea name="contenu" rows="30" cols="60">'
										.$page['contenuPage'].
										'</textarea>
									</td>
								</tr>
								<tr>
									<td>
										<input type = "hidden" name = "numPage" value = '.$page['numPage'].' />
										<input type = "hidden" name = "do" value = "modifierPage" />
										<input type = "submit" value = "Modifier" />
									</td>
								</tr>
						</table>
					</form>';
			}
			
			$queryUnePage->closeCursor();
		}
		else{
			echo '<table border = 1>';

			$reqRubriques = "SELECT * FROM pages";
			$queryListeRubriques = $bdd->query($reqRubriques);

			while ($page = $queryListeRubriques->fetch()){
				echo '
					<tr>
						<td>
							'.$page['libellePage'].'
						</td>
						<td>
							<form action = "index.php" method = "get">
							<input type = "hidden" name = "page" value = "Admin" />
							<input type = "hidden" name = "action" value = "gererPages" />
							<input type = "hidden" name = "numPage" value = '.$page['numPage'].' />
							<input type = "submit" value = "Modifier" />
							</form>
						</td>
					</tr>';
			}
			echo '</table>';
			$queryListeRubriques->closeCursor();
		}
?>